//
// Created by v on 24-6-4.
//

#include <getopt.h>
#include <stdio.h>
#include <assert.h>

#include "base_image_operation.h"

void test_image_base_operation(char *input, char *output)
{
    BaseImageOperation baseImageOperation;
    printf("op of input [%s] output[%s]\n", input, output);
    baseImageOperation.two_value_image(input, output);
//    baseImageOperation.rotateIt(input, output);
    baseImageOperation.resizeIt(input, output);
}

int main(int argc, char **args)
{
    printf("startup [%s:%s]\n", __DATE__, __TIME__);
    char *input = NULL;
    char *output = NULL;
    int c = -1;
    while ((c = getopt(argc, args, "i:o:")) != -1)
    {
        switch (c)
        {
            case 'i':
                input = optarg;
                break;
            case 'o':
                output = optarg;
                break;
            default:
                printf("Usage: %s -i [input file] -o [output file]\n", args[0]);
                return 0;
        }
    }
    if (!input || !output)
    {
        printf("Usage: %s -i [input file] -o [output file]\n", args[0]);
        return 0;
    }

    test_image_base_operation(input, output);
    return 0;
}
